<template>
  <div class="sop_list table-theme">
    <el-breadcrumb separator="/">
      <el-breadcrumb-item>公众号--咨询回复列表</el-breadcrumb-item>
    </el-breadcrumb>
    <el-card>
      <p style="text-align: right; line-height: 30px">总列表数：{{ total }}</p>
      <el-table
        :data="list"
        stripe
        border
      >
        <el-table-column
          label="序号"
          align="center"
          prop="gzh_user_msg_answer_id"
        >
        </el-table-column>
        <el-table-column
          label="ID"
          align="center"
          prop="gzh_user_msg_id"
        >
        </el-table-column>
        <el-table-column
          label="open_id"
          align="center"
          prop="open_id"
          v-if="admin_id == 1"
        ></el-table-column>
        <el-table-column
          label="微信识别号"
          align="center"
          prop="to_user_name"
          v-if="admin_id == 1"
        ></el-table-column>
        <el-table-column
          label="回复内容"
          align="center"
          prop="content"
        ></el-table-column>
        <el-table-column
          label="类型"
          align="center"
          prop="type"
        ></el-table-column>
        <el-table-column
          label="时间"
          align="center"
          prop="add_time"
          width="220"
        ></el-table-column>
      </el-table>
      <div class="pages">
        <el-pagination
          background
          layout="prev, pager, next, jumper"
          :total="total"
          @current-change="init"
          :current-page="page"
          :page-size="limit"
        ></el-pagination>
      </div>
    </el-card>
  </div>
</template>
<script>
export default {
    props:['gzh_user_msg_id'],
    data () {
        return {
            list:[],
            page:1,
            limit:10,
            total:0,
            admin_id:localStorage.getItem('admin_id')
        }
    },
    methods: {
        init(e){
            let data ={
                gzh_user_msg_id:this.gzh_user_msg_id,
                page:e?e-1:0,
                limit:this.limit
            }
            this.$http(this.$ApiList.SopUserConsultAnswerList,data).then(res=>{
                this.list = res.datas.data;
                this.total = res.datas.count;
            })
        }
    },
    created () {
        this.init();
    }
}
</script>
<style scoped>
.sop_list{
    padding: 20px;
    width: 100%;
}
.el-select {
  width: 100%;
}
.cell button {
  margin-bottom: 10px;
}
</style>